/**
 * Created by PC on 2016/1/18.
 */
class ResUtils {

    /*
    加载资源，如果有资源的了话马上返回，如果没有，则异步加载之后回调(回调参数是加载的资源)
     */
    public static getRes(name:string,callback?:Function,thisObject?:any) {
        var res = RES.getRes(name);
        if(!res) {
            RES.getResAsync(name,function() {
                if(callback){
                    var r = RES.getRes(name);
                    callback.apply(thisObject,[r]);
                }
            },this);
        }else{
            return res;
        }
    }

}